package Day1Zuoye;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class Compare {
    public static void main(String[] args) {
        List array=new ArrayList();
        long time=System.currentTimeMillis();
        for (int i=0;i<100000;i++){
            array.add("1");
        }
        for (int j=0;j<100;j++){
            array.remove("1");
        }
long time1=System.currentTimeMillis();
        long time2=time1-time;
        System.out.println("ArrayList:"+time2);

        long time3=System.currentTimeMillis();
        List linked=new LinkedList();
        for (int i=0;i<100000;i++){
            linked.add("1");
        }
        for (int j=0;j<100;j++){
           linked.remove("1");
        }
        long time4=System.currentTimeMillis();
        long time5=time4-time3;
        System.out.println("LinkedList:"+time5);


        long z=time5>time2?time5:time2;
        System.out.println(z);





    }
}
